package com.king.utils;

import com.alibaba.druid.pool.DruidDataSource;

/**
 * @ClassName: DruidUtils
 * @Description: 数据库连接池
 * @Author: wangchangyong
 * @Date: 2020/4/7 14:08
 * @Version: 1.0.0
 **/
public class DruidUtils {

    private DruidUtils() {
    }

    private static DruidDataSource druidDataSource = new DruidDataSource();

    static {
        druidDataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
        druidDataSource.setUrl("jdbc:mysql://localhost:3306/lagou");
        druidDataSource.setUsername("root");
        druidDataSource.setPassword("root@2019");
    }

    public static DruidDataSource getInstance() {
        return druidDataSource;
    }

}
